package com.iqiyi.qigsaw.sample.java

import acom.dhy.qigsaw2test.App
import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.widget.Toast
import com.dhy.annotations.Component
import com.dhy.qigsaw.splash.data.TestCase

@Component
class MyService : Service() {
    override fun onCreate() {
        super.onCreate()
    }

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        val hello = Util.getString(this, R.string.hello_service_hello)
        val service = getString(R.string.hello_service_service)
        Toast.makeText(this, "$hello $service", Toast.LENGTH_SHORT).show()
        App.testCases[TestCase.SERVICE] = true
        return super.onStartCommand(intent, flags, startId)
    }

    override fun onBind(intent: Intent): IBinder? {
        return null
    }
}